<template>
  <el-header id="header" class="navbar" style="position: sticky; top: 0; z-index: 100;">
    <!-- 左侧文字 logo -->
    <div class="logo">My Logo</div>
    <!-- 右侧用户下拉菜单 -->
    <div class="user-menu">
      <el-dropdown>
        <span class="el-dropdown-link">
          Current User <i class="el-icon-arrow-down el-icon--right"></i>
        </span>
        <template #dropdown>
          <el-dropdown-menu>
            <el-dropdown-item><el-icon><UserFilled /></el-icon>个人主页</el-dropdown-item>
            <el-dropdown-item><el-icon><i class="fa-solid fa-right-from-bracket"></i></el-icon>登出</el-dropdown-item>
          </el-dropdown-menu>
        </template>
      </el-dropdown>
    </div>
  </el-header>
</template>

<script setup>
// 这里可以添加组件的逻辑代码
import {onMounted} from "vue";

onMounted(()=>{
  if(window.location.href.includes("/licenses")){
    document.getElementById('header').style.display='none';
  }
})
</script>

<style scoped>
.navbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  color: #000;
  padding: 0 20px;
  border-bottom: 1px solid #ddd;
}

.logo {
  font-size: 24px;
  font-weight: bold;
}

.user-menu {
  cursor: pointer;
}
</style>